home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
graphic
/
jpegsrc4.zip
/
SETUP
< prev
next >
Wrap
Text File
|
1992-12-08
|
27KB
|
523 lines
SETUP instructions for the Independent JPEG Group's JPEG software
=================================================================
This file explains how to configure and compile the JPEG software. We have
tried to make this software extremely portable and flexible, so that it can be
adapted to almost any environment. The downside of this decision is that the
installation process is not very automatic; you will need at least a little
familiarity with C programming and program build procedures for your system.
This file contains general instructions, then sections of specific hints for
certain systems. You may save yourself considerable time if you scan the
whole file before starting to do anything.
Before installing the software you must unpack the distributed source code.
Since you are reading this file, you have probably already succeeded in this
task. However, there is one potential trap if you are on a non-Unix system:
you may need to convert these files to the local standard text file format
(for example, if you are on MS-DOS you probably have to convert LF end-of-line
to CR/LF). If so, apply the conversion to all the files EXCEPT those whose
names begin with "test". The test files contain binary data; if you change
them in any way then the self-test will give bad results.
STEP 1: PREPARE A MAKEFILE
==========================
First, select a makefile and copy it to "Makefile" (or whatever your version
of make uses as the default makefile name; for example, "makefile.mak" for
old versions of Borland C). We include several standard makefiles in the
distribution:
makefile.ansi: for Unix systems with ANSI-compatible C compilers.
makefile.unix: for Unix systems with non-ANSI C compilers.
makefile.mc5: for Microsoft C 5.x under MS-DOS.
makefile.mc6: for Microsoft C 6.x and up under MS-DOS.
makefile.bcc: for Borland C (Turbo C) under MS-DOS.
makefile.manx: for Manx Aztec C on Amigas.
makefile.sas: for SAS C on Amigas.
makcjpeg.st: project file for Atari ST/STE/TT Pure C or Turbo C.
makdjpeg.st: project file for Atari ST/STE/TT Pure C or Turbo C.
makljpeg.st: project file for Atari ST/STE/TT Pure C or Turbo C.
makefile.mms: for VAX/VMS systems with MMS.
makefile.vms: for VAX/VMS systems without MMS.
If you don't see a makefile for your system, we recommend starting from either
makefile.ansi or makefile.unix, depending on whether your compiler accepts
ANSI C or not. Actually you should start with makefile.ansi whenever your
compiler supports ANSI-style function definitions; you don't need full ANSI
compatibility. The difference between the two makefiles is that makefile.unix
preprocesses the source code to convert function definitions to old-style C.
(Our thanks to Peter Deutsch of Aladdin Enterprises for the ansi2knr program.)
If you don't know whether your compiler supports ANSI-style function
definitions, then take a look at ckconfig.c. It is a test program that will
help you figure out this fact, as well as some other facts you'll need in
later steps. You must compile and execute ckconfig.c by hand; the makefiles
don't provide any support for this. ckconfig.c may not compile the first try
(in fact, the whole idea is for it to fail if anything is going to). If you
get compile errors, fix them by editing ckconfig.c according to the directions
given in ckconfig.c. Once you get it to run, select a makefile according to
the advice it prints out, and make any other changes it recommends.
Look over the selected Makefile and adjust options as needed. In particular
you may want to change the CC and CFLAGS definitions. For instance, if you
are using GCC, set CC=gcc. If you had to use any compiler switches to get
ckconfig.c to work, make sure the same switches are in CFLAGS.
If you are on a system that doesn't use makefiles, you'll need to set up
project files (or whatever you do use) to compile all the source files and
link them into executable files cjpeg and djpeg. See the file lists in any of
the makefiles to find out which files go into each program. As a last resort,
you can make a batch script that just compiles everything and links it all
together; makefile.vms is an example of this (it's for VMS systems that have
no make-like utility).
STEP 2: EDIT JCONFIG.H
======================
Look over jconfig.h and adjust #defines to reflect the properties of your
system and C compiler. If you prefer, you can usually leave jconfig.h
unmodified and add -Dsymbol switches to the Makefile's CFLAGS definition.
(This is already done if you used a compiler-specific makefile in step 1.)
However, putting the switches in the Makefile is a bad idea if you are going
to incorporate the JPEG software into other programs --- you'd need to include
the same -D switches in the other programs' Makefiles. Better to change
jconfig.h.
If you have an ANSI-compliant C compiler, no changes should be necessary
except perhaps for RIGHT_SHIFT_IS_UNSIGNED and TWO_FILE_COMMANDLINE. For
older compilers other changes may be needed, depending on what ANSI features
are supported.
If you don't know enough about C programming to understand the questions in
jconfig.h, then use ckconfig.c to figure out what to change. (See description
of ckconfig.c in step 1.)
A note about TWO_FILE_COMMANDLINE: defining this selects the command line
syntax in which the input and output files are both named on the command line.
If it's not defined, the output image goes to standard output, and the input
can optionally come from standard input. You MUST use two-file style on any
system that doesn't cope well with binary data fed through stdin/stdout; this
is true for most MS-DOS compilers, for example. If you're not on a Unix
system, it's probably safest to assume you need two-file style.
STEP 3: SELECT SYSTEM-DEPENDENT FILES
=====================================
A few places in the JPEG software are so system-dependent that we have to
provide several different implementations and let you select the one you need.
The only system-dependent file in the current version is jmemsys.c. This file
controls use of temporary files for big images that won't fit in main memory.
You'll notice there is no file named jmemsys.c in the distribution; you must
select one of the provided versions and copy, rename, or link it to jmemsys.c.
Here are the provided versions:
jmemansi.c This is a reasonably portable version that should
work on most ANSI and near-ANSI C compilers. It uses
the ANSI-standard library routine tmpfile(), which not
all non-ANSI systems have. On some systems tmpfile()
may put the temporary file in a non-optimal location;
if you don't like what it does, use jmemname.c.
jmemname.c This version constructs the temp file name by itself.
For anything except a Unix machine, you'll need to
configure the select_file_name() routine appropriately;
see the comments near the head of jmemname.c.
If you use this version, define NEED_SIGNAL_CATCHER
in jconfig.h or in the Makefile to make sure the temp
files are removed if the program is aborted.
jmemnobs.c (That stands for No Backing Store :-). This will
compile on almost any system, but it assumes you
have enough main memory or virtual memory to hold
the biggest images you need to work with.
jmemdos.c This should be used in most MS-DOS installations; see
the system-specific notes about MS-DOS for more info.
IMPORTANT: if you use this, also copy jmemdos.h to
jmemsys.h, replacing the standard version. ALSO,
include the assembly file jmemdosa.asm in the programs.
(This last is already done if you used one of the
supplied MS-DOS-specific makefiles.)
If you have plenty of (real or virtual) main memory, just use jmemnobs.c.
"Plenty" means at least ten bytes for every pixel in the largest images
you plan to process, so a lot of systems don't meet this criterion.
If yours doesn't, try jmemansi.c first. If that doesn't compile, you'll have
to use jmemname.c; be sure to adjust select_file_name() for l